package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @Author ZhaoQiuWei
 * @Date 2021/12/16 15:42
 */
@Component
public class ImportSignInMethodConvertor implements FieldValueConvert<String, Integer> {

    @Override
    public Integer convert(Object bean, String value, DataDumpField dataField) {
        if (StringUtils.isNotBlank(value)) {
            value = value.trim();
            if (value.equals("不签到")) {
                return 2;
            } else if (value.equals("定位签到")) {
                return 0;
            } else if (value.equals("NFC签到")) {
                return 1;
            } else if (value.equals("二维码签到")) {
                return 3;
            }
        }
        return null;
    }
}
